package com.yiqi.liebang.feature.mine.view.adapter;

import android.graphics.Paint;
import android.view.View;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.suozhang.framework.framework.AM;
import com.yiqi.liebang.R;
import com.yiqi.liebang.common.widget.RatingBar;
import com.yiqi.liebang.entity.bo.QuestionBo;
import com.yiqi.liebang.entity.bo.UserCenterBo;

public class WorkAdapter extends BaseQuickAdapter<UserCenterBo.OccupationAuthenticationBean, BaseViewHolder> {
    boolean isShow=false;boolean isLookMe=false;

    public WorkAdapter(boolean isShow,boolean isLookMe) {
        super(R.layout.item_userinfo_work);
        this.isShow = isShow;
        this.isLookMe=isLookMe;
    }

    @Override
    protected void convert(BaseViewHolder helper, UserCenterBo.OccupationAuthenticationBean item) {
        helper.setVisible(R.id.btn_userinfo_work_edit, isShow)
                .addOnClickListener(R.id.btn_userinfo_work_edit)
                .addOnClickListener(R.id.btn_userinfo_work_renzheng)
                .setText(R.id.tv_work_company_name, item.getCompany())
                .setVisible(R.id.iv_user_position, item.getStatus() == 1 ? true : false)
                .setText(R.id.tv_work_company_position, item.getBeginTime() + " - " + item.getEndTime() + " , " + item.getPosition())
                .setText(R.id.tv_work_company_info, item.getDescribeInfo())
        ;
        AM.image().bindToCircleObject(item.getComLogo(), helper.getView(R.id.iv_work_logo));

        if (item.getStatus() == 1 && !isShow||!isLookMe) {
            helper.getView(R.id.btn_userinfo_work_renzheng).setVisibility(View.GONE);
        } else if (item.getStatus() == 0 && isShow&&isLookMe){
            helper.getView(R.id.btn_userinfo_work_renzheng).setVisibility(View.VISIBLE);
        }

    }
}
